
import {request,requestyt,getRequestrhtx} from "./request.js";  //导入封装请求的js文件

export function get1(url,params) {
  return request({
    url: url,  //接口路径
    method: "get",  //接口方法
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
    params  //接口参数
  });
}
export function getBroadcast(url,params) {
  return request({
    url: url,  //接口路径
    method: "get",  //接口方法
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
    params  //接口参数
  });
}
export function getFile(url,params) {
  return request({
    url: url,  //接口路径
    method: "get",  //接口方法
    responseType: "blob",
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
    params  //接口参数
  });
}

export function post(url,data) {
  return request({
    url:url,
    method: "post",
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
    data
  });
}
export function postUploud(url,data) {
  return request({
    url: url,
    method: "post",
    headers: { 'Content-Type': 'multipart/form-data' }, //多文件上传这一句必须加
    data,
  });
}
export function postCommon(url,data) {
  return request({
    url:url,
    method: "post",
    data,
  });
}
  export function deletechild(url) {
    return request({
      url: url,  //接口路径
      method: "delete",  //接口方法
      headers: {
        //设置后端需要的传参类型
        'Content-Type': 'application/json;charset=utf-8',

      },
    });

  }
  export function getInformation(url,params){
    return requestyt({
      url: url,  //接口路径
      method: "get",  //接口方法
      headers: {
        //设置后端需要的传参类型
        'Content-Type': 'application/json;charset=utf-8',
      },
      params  //接口参数
    });
  }
  export function postInformation(url,params){
    return requestyt({
      url: url,
      method: "post",
      headers: {
        //设置后端需要的传参类型
        'Content-Type': 'application/json;charset=utf-8',

      },
    });
  }
  export function postDepartInfoInformation(url,params){
    return requestyt({
      url: url,
      method: "post",
      headers: {
        //设置后端需要的传参类型
        'Content-Type': 'application/json;charset=utf-8',

      },
      data:params
    });
  }
  export function postRequestrhtx(ipconfig,url,params){
    const requestrhtx = getRequestrhtx(ipconfig)
    return requestrhtx({
      url: url,
      method: "post",
      headers: {
        //设置后端需要的传参类型
        'Content-Type': 'application/json;charset=utf-8',
      },
    });
  }
export function getUserDepartment(url){
  return requestyt({
    url: url,
    method: "get",
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export function getAuthWho(){
  return requestyt({
    url: "/auth/who",
    method: "get",
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export function getOrganizationUserList(url){
  return requestyt({
    url: url,
    method: "get",
    headers: {
      //设置后端需要的传参类型
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export function postAddHeader(url,data,headersdata) {
  console.log('headersdata', headersdata)
  return request({
    url:url,
    method: "post",
    headers: {
      //设置后端需要的传参类型
    'Content-Type': 'application/json;charset=utf-8',
        'tenant-code': headersdata.value.tenantId,
        'tenantCode': headersdata.value.tenantId,
        'tenantId': headersdata.value.tenantId,
      },
    data
  });
}
